#ifndef NETWORK_NETWORKFRIENDRESPONSE_H
#define NETWORK_NETWORKFRIENDRESPONSE_H
#include "network/networkjsonlistresponse.h"
#include <QMap>
namespace Account {

class FriendResponse : public Network::JSONListResponse
{
    Q_OBJECT
public:
    class Item
    {
    public:
        Item(int userid,
             const QString &userName,
             const QString &displayName,
             const QString &avatar);

        inline int userId() const {
            return m_userId;
        }


        inline const QString &userName() const {
            return m_userName;
        }


        inline const QString &displayName() const {
            return m_displayName;
        }


        inline const QString &avatar() const {
            return m_avatar;
        }
    private:
        int m_userId;
        QString m_userName;
        QString m_displayName;
        QString m_avatar;

    };

public:
    explicit FriendResponse(QObject *parent = 0);
    ~FriendResponse();

public:
    Network::Response::Type type() const;

    typedef QMap<int, Item *> Items;
    inline const Items &items() const {
        return m_items;
    }

private:
    void parseList(const QVariantList &list);

private:
    Items m_items;
};

} // namespace network

#endif // NETWORK_NETWORKFRIENDRESPONSE_H
